<!DOCTYPE html>
<html>
<head lang="zh">
	<meta charset="UTF-8">
	<link rel="stylesheet" href="../css/base.css">
	<title>跨文档传递消息的示例</title>
</head>
<body>
<noscript>此文档需要JavaScript支持才能正常使用</noscript>
<p id="status">Ready</p>
<p>这里用iframe嵌入了另一个页面</p>
<button id="send">Send Message</button>
<p>
	<iframe name="nested" src="./otherdomain.html" width="90%" height="175px"></iframe>
</p>
<!-- JavaScript脚本链接请在此处插入 -->
<script>
	document.getElementById('send').onclick = function(){
		window['nested'].postMessage('I like apples', 'http://localhost:63342/');
		document.getElementById('status').innerHTML = 'Message Sent';
	};
</script>
</body>
</html>